package com.piccolo.wrapper.client.component;

import com.google.gwt.widgetideas.graphics.client.GWTCanvas;
import com.piccolo.wrapper.client.component.Overlay.PCanvasOverlay;

/**
 * @author Maria Patrickson
 * @version 1.0
 */
public class PCanvas extends GWTCanvas
{
	private PCanvasOverlay overlay;

	/**
	 * Creates a PCanvas with the supplied dimensions
	 * @param width
	 * @param height
	 */
	public PCanvas(int width, int height) 
	{
		super(width, height);
		overlay = PCanvasOverlay.create(this.getElement());
	}

	/**
	 * @return The JavaScript overlay object for this PCanvas
	 */
	public PCanvasOverlay getOverlay()
	{
		return overlay;
	}

	/**
	 * @return The PCamera for this PCanvas
	 */
	public PCamera getCamera()
	{
		return overlay.getCamera();
	}
}